/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author marduke
 */

import nanoxml.XMLElement;
import java.io.*;
import java.util.Enumeration;
import java.util.Vector;

public class DumpXML {

    public static void main(String[] args)
            throws Exception {
                  XMLElement xml = new XMLElement();
            FileReader reader = new FileReader("fotos.xml");
            xml.parseFromReader(reader);
Enumeration children = xml.enumerateChildren();
        while(children.hasMoreElements()) {
                    XMLElement child = (XMLElement) children.nextElement();
                    if(child.getName().compareTo("titulo") == 0) {
                        System.out.println(child.getContent());
                        }
                    }
                }

        XMLElement elt = new XMLElement();
       elt.setName("Maquinas");
       XMLElement child = new XMLElement();
       child.setName("elemento");
       child.setAttribute("jodete", "demasiado es mucho");
       child.setAttribute("ip", "localhost");


       elt.addChild(child);



    System.out.println(child.getAttribute("jodete"));

       System.out.println(elt.toString());
//
//       XMLElement mmlodemasiado =new XMLElement();
//       mmlodemasiado.parseString(elt.toString());
//
//       System.out.println(mmlodemasiado.getName());
    }

